﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hxj.Data;
using System.Data;
using Hxj.Data.Common;

namespace Utility.Model
{
    /// <summary>
    /// 应用程序注册实体
    /// </summary>
    [Serializable]
    public class Sys_AppReg : Entity
    {
        /// <summary>
        /// 实例化应用程序注册实体
        /// </summary>
        public Sys_AppReg()
            : base("Sys_AppReg")
        {
            this._AppID = Guid.NewGuid().ToString();
            this._CreateDate = Utility.ConvertHelper.GetNowDateTime();
            this._IsDelete = false;
        }

        #region Model
        private string _AppID;
        private string _AppCode;
        private string _AppName;
        private DateTime? _RegDate;
        private string _LinkAddress;
        private bool? _IsDelete;
        private DateTime? _CreateDate;
        private string _CreateUser;
        /// <summary>
        /// 主键ID
        /// </summary>
        public string AppID
        {
            get { return _AppID; }
            set
            {
                this.OnPropertyValueChange(_.AppID, _AppID, value);
                this._AppID = value;
            }
        }
        /// <summary>
        /// 应用程序Code
        /// </summary>
        public string AppCode
        {
            get { return _AppCode; }
            set
            {
                this.OnPropertyValueChange(_.AppCode, _AppCode, value);
                this._AppCode = value;
            }
        }
        /// <summary>
        /// 应用程序名称
        /// </summary>
        public string AppName
        {
            get { return _AppName; }
            set
            {
                this.OnPropertyValueChange(_.AppName, _AppName, value);
                this._AppName = value;
            }
        }
        /// <summary>
        /// 注册日期
        /// </summary>
        public DateTime? RegDate
        {
            get { return _RegDate; }
            set
            {
                this.OnPropertyValueChange(_.RegDate, _RegDate, value);
                this._RegDate = value;
            }
        }
        /// <summary>
        /// 连接地址
        /// </summary>
        public string LinkAddress
        {
            get { return _LinkAddress; }
            set
            {
                this.OnPropertyValueChange(_.LinkAddress, _LinkAddress, value);
                this._LinkAddress = value;
            }
        }
        /// <summary>
        /// 是否删除
        /// </summary>
        public bool? IsDelete
        {
            get { return _IsDelete; }
            set
            {
                this.OnPropertyValueChange(_.IsDelete, _IsDelete, value);
                this._IsDelete = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public DateTime? CreateDate
        {
            get { return _CreateDate; }
            set
            {
                this.OnPropertyValueChange(_.CreateDate, _CreateDate, value);
                this._CreateDate = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string CreateUser
        {
            get { return _CreateUser; }
            set
            {
                this.OnPropertyValueChange(_.CreateUser, _CreateUser, value);
                this._CreateUser = value;
            }
        }
        #endregion

        #region Method
        /// <summary>
        /// 获取实体中的主键列
        /// </summary>
        public override Field[] GetPrimaryKeyFields()
        {
            return new Field[] {
				_.AppID};
        }
        /// <summary>
        /// 获取列信息
        /// </summary>
        public override Field[] GetFields()
        {
            return new Field[] {
				_.AppID,
				_.AppCode,
				_.AppName,
				_.RegDate,
				_.LinkAddress,
				_.IsDelete,
				_.CreateDate,
				_.CreateUser};
        }
        /// <summary>
        /// 获取值信息
        /// </summary>
        public override object[] GetValues()
        {
            return new object[] {
				this._AppID,
				this._AppCode,
				this._AppName,
				this._RegDate,
				this._LinkAddress,
				this._IsDelete,
				this._CreateDate,
				this._CreateUser};
        }
        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        public override void SetPropertyValues(IDataReader reader)
        {
            this._AppID = DataUtils.ConvertValue<string>(reader["AppID"]);
            this._AppCode = DataUtils.ConvertValue<string>(reader["AppCode"]);
            this._AppName = DataUtils.ConvertValue<string>(reader["AppName"]);
            this._RegDate = DataUtils.ConvertValue<DateTime?>(reader["RegDate"]);
            this._LinkAddress = DataUtils.ConvertValue<string>(reader["LinkAddress"]);
            this._IsDelete = DataUtils.ConvertValue<bool?>(reader["IsDelete"]);
            this._CreateDate = DataUtils.ConvertValue<DateTime?>(reader["CreateDate"]);
            this._CreateUser = DataUtils.ConvertValue<string>(reader["CreateUser"]);
        }
        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        public override void SetPropertyValues(DataRow row)
        {
            this._AppID = DataUtils.ConvertValue<string>(row["AppID"]);
            this._AppCode = DataUtils.ConvertValue<string>(row["AppCode"]);
            this._AppName = DataUtils.ConvertValue<string>(row["AppName"]);
            this._RegDate = DataUtils.ConvertValue<DateTime?>(row["RegDate"]);
            this._LinkAddress = DataUtils.ConvertValue<string>(row["LinkAddress"]);
            this._IsDelete = DataUtils.ConvertValue<bool?>(row["IsDelete"]);
            this._CreateDate = DataUtils.ConvertValue<DateTime?>(row["CreateDate"]);
            this._CreateUser = DataUtils.ConvertValue<string>(row["CreateUser"]);
        }
        #endregion

        #region _Field
        /// <summary>
        /// 字段信息
        /// </summary>
        public class _
        {
            /// <summary>
            /// * 
            /// </summary>
            public readonly static Field All = new Field("*", "Sys_AppReg");
            /// <summary>
            /// 主键ID
            /// </summary>
            public readonly static Field AppID = new Field("AppID", "Sys_AppReg", "主键ID");
            /// <summary>
            /// 应用程序Code
            /// </summary>
            public readonly static Field AppCode = new Field("AppCode", "Sys_AppReg", "应用程序Code");
            /// <summary>
            /// 应用程序名称
            /// </summary>
            public readonly static Field AppName = new Field("AppName", "Sys_AppReg", "应用程序名称");
            /// <summary>
            /// 注册日期
            /// </summary>
            public readonly static Field RegDate = new Field("RegDate", "Sys_AppReg", "注册日期");
            /// <summary>
            /// 连接地址
            /// </summary>
            public readonly static Field LinkAddress = new Field("LinkAddress", "Sys_AppReg", "连接地址");
            /// <summary>
            /// 是否删除
            /// </summary>
            public readonly static Field IsDelete = new Field("IsDelete", "Sys_AppReg", "是否删除");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field CreateDate = new Field("CreateDate", "Sys_AppReg", "CreateDate");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field CreateUser = new Field("CreateUser", "Sys_AppReg", "CreateUser");
        }
        #endregion


    }
}

